#include <iostream>
#include <memory>

using namespace std;


int main(){
    shared_ptr<int> p1(new int(10));
    shared_ptr<int> p2(p1);
    cout << p1.use_count() << endl;
    weak_ptr<int> wp = p1;
    cout << p1.use_count() << endl;
    shared_ptr<int> p3 = wp.lock();
    cout << p1.use_count() << endl;
    return 0;
}